package com.zhilianbao.leyaogo.ui.adapter.home.applista;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.zhilianbao.leyaogo.R;

import me.drakeet.multitype.ItemViewProvider;

/**
 * 首页 专题标题 ItemViewProvider
 */
public class HomeTopicTitleViewProvider
        extends ItemViewProvider<HomeTopicTitle, HomeTopicTitleViewProvider.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(
            @NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_home_topic_title, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(
            @NonNull ViewHolder holder, @NonNull HomeTopicTitle homeTopicTitle) {
        holder.mTitle.setText(homeTopicTitle.getTitle());
    }

    static class ViewHolder extends RecyclerView.ViewHolder {

        private TextView mTitle;

        ViewHolder(View itemView) {
            super(itemView);
            mTitle = (TextView) itemView.findViewById(R.id.tv_topic_title);

        }
    }
}